const install = (Vue, vm) => {
	vm.$u.api = {
		//登录
		login:(params = "",data={},header = {}) => vm.$u.post(`/auth/oauth/token?${params}`, data,header),
		//微信绑定
		bindwechat:(code = '',header = {}) => vm.$u.post(`/admin/social/bindMini?${code}`,{},header),
		//微信登录
		loginByWechat:(code = '',header = {}) => vm.$u.get(`/admin/social/login/MINI@${code}@MATERIALS`, {},header),
		//退出
		loginout:(params = {},header = {}) => vm.$u.delete("/auth/token/logout", params,header),
		//获取项目列表
		getProjects:(params = {},header = {}) => vm.$u.post("/admin/user/getProjectDept", params,header),
		
		
		//权限-菜单列表
		getAuth:(projectId,header = {}) => vm.$u.get(`/admin/menu/smartBuild/tree/${projectId}`,{},header),
		//权限-权限列表
		getUserAuth:(params = {},header = {}) => vm.$u.post(`/act/user/act_permission/list`,params,header),
		
		//上传
		upload:(params = {},header = {}) => vm.$u.post("/admin/sys-file/upload", params,header),
		
		//获取物料类型
		getCementType:(params = {},header = {}) => vm.$u.post("/ms/sku/page", params,header),
		//获取地图位置列表
		getPositionList:(params = {},header = {}) => vm.$u.post("/ms/location/page", params,header),
		//获取供应商列表
		getSupplierList:(params = {},header = {}) => vm.$u.post("/ms/supplier/page", params,header),
		
		//新增采购计划
		addPlan:(params = {},header = {}) => vm.$u.post("/ms/order/add", params,header),
		
		//订单详情
		getOrderDetail:(id = null,params = {},header = {}) => vm.$u.get(`/ms/order/details/${id}`, params,header),
		//采购计划审批
		reviewOrder:(params = {},header = {}) => vm.$u.post("/ms/order/review", params,header),
		//分页获取订单列表
		getOrderList:(params = {}, header = {}) => vm.$u.post("/ms/order/page", params, header),
		
		//司机填写信息
		insert:(params = {}, header = {}) => vm.$u.post("/ms/open_api/insert_weight_details", params, header),
		//司机获取供应商列表
		driverSupplier:(params = {}, header = {}) => vm.$u.post("/ms/open_api/supplier_page", params, header),
		//司机获取订单
		driverOrder:(params = {}, header = {}) => vm.$u.post("/ms/open_api/order_page", params, header),
		//司机导航
		driverLocation:(params = {}, header = {}) => vm.$u.post("/ms/open_api/order_details/{id}", params, header),
		
		//采购计划-获取收货人列表
		receiverList:(params = {},header = {}) => vm.$u.post("/act/procurement_plan/receiver/list", params,header),
		//采购计划列表
		getPlanList:(params = {},header = {}) => vm.$u.post("/act/procurement_plan/list_page", params,header),
		//采购计划详情
		getPlanDetail:(id = null,params = {},header = {}) => vm.$u.get(`/ms/order/details/${id}`, params,header),
		//采购计划保存草稿
		draftPlan:(params = {},header = {}) => vm.$u.post("/act/procurement_plan/draft", params,header),
		//采购计划修改
		updatePlan:(params = {},header = {}) => vm.$u.post("/act/procurement_plan/update", params,header),
		//采购计划审批
		reviewPlan:(params = {},header = {}) => vm.$u.post("/act/procurement_plan/review", params,header),
		//采购计划撤回
		cancelPlan:(params = {},header = {}) => vm.$u.post("/act/procurement_plan/cancel", params,header),
		

		//项目组确认订单
		confirmOrder:(params = {}, header = {}) => vm.$u.post("/act/order/confirm", params, header),
		//分页获取订单列表
		//getOrderList:(params = {}, header = {}) => vm.$u.post("/act/order/list_page", params, header),
		//查询发货任务，分页列表
		getOrderTaskList:(params = {}, header = {}) => vm.$u.post(`/act/order/task/list`, params, header),
		//确认收货
		orderReceive:(params = {}, header = {}) => vm.$u.post(`/act/order/receive`, params, header),
		//取消订单
		cancelOrder:(params = {},header = {}) => vm.$u.post("/act/order/cancel", params,header),
		//申请订单验收
		applyOrder:(params = {},header = {}) => vm.$u.post("/ms/order/acceptance/apply", params,header),
		//订单验收审核
		applyOrderReview:(params = {},header = {}) => vm.$u.post("/ms/order/acceptance/review", params,header),
		
		//分页获取待办列表
		getTodoList:(params = {}, header = {}) => vm.$u.post("/ms/order/todo/all/list_page", params, header),
		//分页获取我申请列表
		getMyList:(params = {}, header = {}) => vm.$u.post("/ms/order/apply_page", params, header),
		
		//查询地磅流水
		getWeightList:(params = {}, header = {}) => vm.$u.post("/ms/weight/page", params, header),
		//手动匹配订单车辆
		match:(params = {}, header = {}) => vm.$u.post("/ms/order/match", params, header),
		//一键收货
		verify:(params = {}, header = {}) => vm.$u.post("/ms/weight_details/batch_verify", params, header),
		
	};
}

export default {
	install
}